package com.cy.aircompressor.main.home.fragment;

import android.os.Bundle;

import androidx.fragment.app.FragmentManager;

import com.cy.aircompressor.R;
import com.cy.aircompressor.databinding.DialogLifecycleLayoutBinding;
import com.cy.aircompressor.databinding.DialogMaintenanceMoreLayoutBinding;
import com.cy.aircompressor.main.home.lifecycle.child.AirCompressorManagerFragment;
import com.cy.aircompressor.main.home.lifecycle.child.ExecutiveMaintenanceFragment;
import com.cy.aircompressor.main.home.lifecycle.child.PartsManagerFragment;
import com.cy.aircompressor.main.home.lifecycle.child.SensorManagerFragment;
import com.cy.aircompressor.main.view.HeaderBar;
import com.cy.aircompressor.main.view.HeaderBarTab;
import com.drug.lib.util.DensityUtil;
import com.jakewharton.rxbinding2.view.RxView;
import com.net.model.base.fragment.BaseVBDialogFragment;

import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.TimeUnit;

import me.yokeyword.fragmentation.SupportFragment;

public class MaintenanceMoreDialogFragment extends BaseVBDialogFragment<DialogMaintenanceMoreLayoutBinding> {
    String compressorId;

    public static void showDialogFragment(FragmentManager fragmentManager, String tag, String compressorId) {
        Bundle args = new Bundle();
        MaintenanceMoreDialogFragment fragment = new MaintenanceMoreDialogFragment();
        args.putString("compressorId", compressorId);
        fragment.setArguments(args);
        fragment.show(fragmentManager, tag);
    }

    @Override
    protected DialogMaintenanceMoreLayoutBinding getViewBinding() {
        return DialogMaintenanceMoreLayoutBinding.inflate(getLayoutInflater());
    }

    @Override
    protected void initData() {
        compressorId = getArguments().getString("compressorId");
        initFragments();
        initView();
    }

    @Override
    protected void requestNetwork() {
    }


    @Override
    protected int getWindowHeight() {
        return (getScreenHeight() - DensityUtil.dip2px(78));
    }

    @Override
    protected int getWindowWidth() {
        return (super.getScreenWidth() - DensityUtil.dip2px(106));
    }

    @Override
    protected void initialize() {

    }


    private void initFragments() {
        loadRootFragment(R.id.fl_container, ExecutiveMaintenanceFragment.newInstance());
    }

    private void initView() {
//        RxView.clicks(mBinding.closeBtn)
//                .throttleFirst(500, TimeUnit.MILLISECONDS)
//                .subscribe(o -> {
//                    dismiss();
//                });
    }
}
